﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace Cangku.cy
{
    public partial class TianJ : Form
    {
        public TianJ()
        {
            InitializeComponent();
        }

        private void qued_Click(object sender, EventArgs e)
        {
            string ckbh = this.CKBH.Text.Trim();
            string ckmc = this.CKMC.Text.Trim();
            DBHelper db = new DBHelper();

            string sql = string.Format("insert into Information select  '{0}', '{1}','True'", ckbh, ckmc);
            bool result = db.ExcuteSql(sql);
            if (result)
            {
                MessageBox.Show("添加成功！");
                CKXX ower = (CKXX)this.Owner;
                ower.LoadCangku();
                this.Close();
            }
            else
            {
                MessageBox.Show("仓库编号必须为数字或者仓库编号已存在！");
                CKBH.Clear();
            }
        }

        private void qux_Click(object sender, EventArgs e)
        {
            CKBH.Clear();
            CKMC.Clear();
        }
    }
}
